package org.bigjava.novelplatform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.bigjava.novelplatform.common.enums.ActionType;
import org.bigjava.novelplatform.entity.CommentAction;

/**
* @author YKH
* @description 针对表【comment_action】的数据库操作Mapper
* @createDate 2022-03-20 14:42:21
* @Entity org.bigjava.novelplatform.entity.CommentAction
*/
public interface CommentActionMapper extends BaseMapper<CommentAction> {

    /**
     * 添加点赞点踩记录
     * @param userId
     * @param id
     * @param like
     */
    void addRecord(@Param("userId") Integer userId, @Param("id") Long id, @Param("type") ActionType like);

    /**
     * 查询用户对评论的记录
     * @param userId
     * @param id
     * @return
     */
    CommentAction selectByUserIdAndCommentId(@Param("userId") Integer userId, @Param("id") Long id);

    /**
     * 修改用户对评论的操作
     * @param userId
     * @param id
     * @param cancel
     */
    void updateRecord(@Param("userId") Integer userId, @Param("id") Long id, @Param("cancel") ActionType cancel);


}




